
<script>
//打印

$('report').addEvent('click',function(){
    var begin_date = $('paybegin_date').get('value');
    var end_date = $('payend_date').get('value');
    var shop_id = $('shop').get('value');
    var data_type = $('conditiondate').get('value');
    var url = "index.php?app=omeanalysts&ctl=analysis_lmreport&act=report";
    url += '&conditiondate=' + data_type + '&shop=' + shop_id + '&paybegin_date=' + begin_date + '&payend_date=' + end_date;
    window.open(url);
});
</script>
<div class="tableform"> 
<h3>订单跟踪汇总表</h3>

<form id="Searchform" action="index.php?app=omeanalysts&ctl=analysis_lmreport&act=index" method="post">
    <div class="division">
        <table width='100%' cellspacing="0" cellpadding="0" >
            <tr>
                <td>
                店铺：
     <select name="shop" id="shop">
      <option value="">全部</option>
      <{foreach from=$shop key=key item=val}>
      <option value="<{$val.shop_id}>" <{if $val.shop_id==$clearingtable.shop_id}>selected<{/if}> ><{$val.name}></option>
      <{/foreach}>
     </select>
                </td>
            </tr>
            <tr>
                <td>
     <select name="conditiondate" id="conditiondate">
      <{foreach from=$conditiondate key=key item=val}>
      <option value="<{$val.id}>" <{if $val.id==$clearingtable.conditiondate_id}>selected<{/if}> ><{$val.name}></option>
      <{/foreach}>
     </select><{input type="time" name="paybegin_date" vtype="required" id="paybegin_date" value="{$clearingtable.paybegin_date}" }>
                至：<{input type="time" value="{$clearingtable.payend_date}"  id="payend_date"  name="payend_date"}>
                <{button class="btn btn-primary" type="submit" id="saveCurrent" label="查询"}>

                <{button class="btn btn-primary" type="button" id="report" label="导出"}>
                </td>
            </tr>
        </table>
   </div>
</form>

<div class="division" id="accordion" style="width:1200px;">
        
        <table width="1000px" cellspacing="0" cellpadding="0" class="gridlist">
            <thead>
            <tr>
                <th style="width:200px;">店铺</th>
                <th style="width:100px;">货号</th>
                <th style="width:200px;">货品名称</th>
                <th style="width:50px;">单位</th>
                <th style="width:100px;">订单量</th>
                <th style="width:60px;">备货量</th>
                <th style="width:60px;">发货量</th>
                <th style="width:60px;">未发量</th>
                <th style="width:60px;">退款量</th>
            </tr>
            </thead>

            <{assign var="key1" value="0"}>
            <{assign var="key2" value="0"}>
            <{assign var="key3" value="0"}>
            <{assign var="key4" value="0"}>
            <{assign var="key5" value="0"}>
              <{foreach from=$comp_data item=his}>
            <{assign var="key1" value=$key1+$his.qty }>
            <{assign var="key2" value=$key2+$his.qty1 }>
            <{assign var="key3" value=$key3+$his.qty2 }>
            <{assign var="key4" value=$key4+$his.qty3 }>
            <{assign var="key5" value=$key5+$his.qty4 }>
              <tbody>
                <tr>
                  <td><{$his.shop_name}></td>
                  <td><{$his.material_bn}></td>
                  <td><{$his.material_name}></td>
                  <td><{$his.unit}></td>
                  <td><{$his.qty}></td>
                  <td><{$his.qty1}></td>
                  <td><{$his.qty2}></td>
                  <td><{$his.qty3}></td>
                  <td><{$his.qty4}></td>
                </tr>
                </tbody>
              <{/foreach}>
                <tr>
                  <td colspan="4"><b style="font-size:12px;color:red;">总数：</b></td>
                  <td><b style="font-size:12px;color:red;"><{$key1}></b></td>
                  <td><b style="font-size:12px;color:red;"><{$key2}></b></td>
                  <td><b style="font-size:12px;color:red;"><{$key3}></b></td>
                  <td><b style="font-size:12px;color:red;"><{$key4}></b></td>
                  <td><b style="font-size:12px;color:red;"><{$key5}></b></td>
                </tr>
        </table>
   </div>
   
   <div class="division">
   </div>
 </div>
